package com.one.group.service;

import com.one.group.model.vo.VehicleSearchVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.rpc.RpcContext;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class VehicleMcpService{

    @DubboReference
    private VehicleService vehicleService;
    @Tool(description = "根据车牌查询车辆信息")
    public List<VehicleSearchVo> queryVehicleInfo(String plateNo) {
        RpcContext.getContext().setAttachment("tenantId", "1");
        return vehicleService.searchVehiclesByPlateNo(plateNo);
    }

}